﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Liya.Crm.Data.Models;
using Liya.Crm.IService;

namespace Liya.Crm.Service
{
    public class RoleUser:IRoleUser
    {
        /// <summary>
        /// 根据用户获取角色
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        public IList<Sys_RoleUser> GetRolesByUser(int userId)
        {
            using (Ly_CrmContext context = new Ly_CrmContext())
            {
                return (from s in context.Sys_RoleUser
                             where s.RUUserId.Equals(userId)
                            select s).ToList();
            }
        }
    }
}
